#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "ntcpsocket.h"
#include "commondef.h"
#include <QFile>
#include <QDataStream>


namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void connectAll();
    void disconnectAll();
private:
    sockInfo sInfo[4];
    QFile *f;
    QDataStream *ds;

    Ui::MainWindow *ui;
    NTcpSocket systemSock;
    NTcpSocket commandSock;
    NTcpSocket videoSock;
    NTcpSocket audioSock;
    void initSockSingnals(QTcpSocket *sock);
    void init();
public slots:
    void connected();
    void disconnected();
    void error(QAbstractSocket::SocketError error);
    void send();
    void readInit();
    void readAudio();
    void readVideo();
    void readCommand();
    void readSystem();
};

#endif // MAINWINDOW_H
